<template>
  <div>
    <nav-bar title="主界面" :leftBack="false" iconName="wap-nav" @clickRight="clickRight"></nav-bar>
      <home-main></home-main>
      <van-action-sheet v-model="show" :actions="actions" @select="onSelect" />
  </div>
</template>
<script>
import NavBar from "../components/NavBar";
import HomeMain from "./Main";
import NJS from "../../tools/nhjssdk";
import tools from "../../tools/tools";
import comm from "../../tools/comm";
import api from "../../tools/api";
export default {
  components: {
    NavBar,
    HomeMain
  },
  data() {
    return {
      show: false,
      actions: [{ name: "页面重载" }, { name: "退出" }]
    };
  },
  mounted() {},
  methods: {
    clickRight() {
      this.show = true;
    },
    onSelect(item) {
      // 默认情况下，点击选项时不会自动关闭菜单
      // 可以通过 close-on-click-action 属性开启自动关闭
      this.show = false;
      // Toast(item.name);
      if ("页面重载" == item.name) {
        location.reload();
      } else if ("退出" == item.name) {
        NJS.app({
          action: "closePage"
        });
      }
    }
  }
};
</script>
<style scoped>

</style>
